Source Formats
isCOBOL supports four types of source format:
You can force the compiler to treat the source files with the rules of a specific source format using
Source Options or the
SOURCE Directive, as summarized in the below table:
Source Format | Option to force it | Directive to force it |
|---|
Fixed | -sa | >>SOURCE FORMAT FIXED |
Free | -sf | >>SOURCE FORMAT FREE |
Terminal | -st | >>SOURCE FORMAT TERMINAL |
Variable | -sv | >>SOURCE FORMAT VARIABLE |
When no option or directive is used, the compiler tries to understand the source format with the following criteria:
1. find the first line with the following characteristics:
• it’s not empty
• it doesn’t have an asterisk at column 1
• it doesn’t have an asterisk at column 7
2. check the content of the line of the line:
• if it includes "*>" anywhere, then the Free format is assumed, else
• if the first byte is either a number from 0 to 9 or space, then the Fixed format is assumed, else
• the Terminal format is assumed.